/**
 * @desc   校务
 * @param  {String}
 * @return {Boolean} 
 */


/* layout */
import Layout from '../views/layout/Layout';

/* logiLayout */
const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);

// 校务
const recipe = resolve => require(['../views/schoolAffair/recipe'], resolve);
const checkRecipeDetail = resolve => require(['../views/schoolAffair/recipeDetail'], resolve);
const peaceAttendance = resolve => require(['../views/peaceManage/peaceAttendance'], resolve); //平安考勤
const attendance = resolve => require(['../views/attendanceManage/attendance'], resolve); //考勤设备
const getAttendance = resolve => require(['../views/attendanceManage/getAttendance'], resolve); //查看考勤设备
const classSetUp = resolve => require(['../views/attendanceManage/classSetUp'], resolve); //分班播报设置
const deviceType = resolve => require(['../views/attendanceManage/deviceType'], resolve); //设备类型
const getdeviceType = resolve => require(['../views/attendanceManage/comps/getdeviceType'], resolve); //查看设备类型
const addAttendance = resolve => require(['../views/attendanceManage/addAttendance'], resolve); //添加考勤设备
const cardManagement = resolve => require(['../views/cardManagementMain/cardManagement'], resolve); //卡片管理
const eDevice = resolve => require(['../views/deviceManagement/eDevice'], resolve);
const addDevice = resolve => require(['../views/deviceManagement/addDevice'], resolve);
const onecardSettlement = resolve => require(['../views/deviceManagement/onecardSettlement'], resolve);

const wisdomCardManage = resolve => require(['../views/deviceManagement/wisdomCardManage'], resolve); //智慧班牌管理
// const wisdomSetting = resolve => require(['../views/deviceManagement/wisdomSetting'], resolve); //智慧班空的布局页面
const screensaver = resolve => require(['../views/deviceManagement/screensaver'], resolve); //智慧班牌设置
const addScreenImg = resolve => require(['../views/deviceManagement/addScreenImg'], resolve); //添加图片
const screenImgEdit = resolve => require(['../views/deviceManagement/addScreenImg'], resolve); //编辑图片

// 校务
export const schoolAffairRouterMap = [{
        path: '/',
        redirect: '/schoolAffair',
        name: '校务',
        hidden: true
    },
    {
        path: '/schoolAffair',
        component: Layout,
        redirect: '/schoolAffair/list',
        name: '食谱管理',
        icon: 'zonghe',
        noDropdown: true,
        meta: {
            cache: 'recipe'
        },
        children: [
            { path: 'list', component: recipe },
            { path: 'recipeDetail/:rId/:sName', component: checkRecipeDetail, name: '食谱详情' }
        ]
    }, {
        path: '/deviceManagement',
        redirect: '/deviceManagement/eDevice',
        name: '设备管理',
        component: Layout,
        icon: 'tuozhuai',
        meta: { role: ['admin', '设备管理'], cache: 'eDevice, wisdomCardManage' },
        noDropdown: false,
        children: [{
                path: '/deviceManagement',
                redirect: '/deviceManagement/eDevice',
                name: '直播设备管理',
                component: logiLayout,
                noDropdown: true,
                children: [
                    { path: 'eDevice', component: eDevice },
                    { path: 'addDevice', component: addDevice, name: '添加设备' },
                ]
            },
            {
                path: 'onecardSettlement',
                component: onecardSettlement,
                name: '一卡通配置'
            },
            {
                path: '/wisdomCardManage',
                redirect: '/wisdomCardManage/wisdomCardManage',
                name: '智慧班牌管理',
                component: logiLayout,
                noDropdown: true,
                children: [
                    { path: 'wisdomCardManage', component: wisdomCardManage },
                    { path: 'screensaver/:id', component: screensaver, name:'智慧班牌设置' },
                    { path: 'addScreenImg/:sPosition/:schoolId', component: addScreenImg, name: '添加图片' },
                    { path: 'screenImgEdit/:id/:sPosition/:schoolId', component: screenImgEdit, name: '编辑图片' },
                ]
            },
        ]
    },
    {
        path: '/peaceAttendance',
        redirect: '/peaceAttendance/index',
        name: '平安考勤',
        icon: 'zujian',
        component: Layout,
        noDropdown: true,
        children: [
            { path: 'index', component: peaceAttendance, name: '平安考勤' }
        ]
    },
    {
        path: '/attendance',
        redirect: '/attendance/index',
        component: Layout,
        name: '考勤设备',
        icon: 'tuozhuai',
        meta: { cache: 'attendance,deviceType' },
        noDropdown: true,
        children: [
            { path: 'index', component: attendance, name: '考勤设备' },
            { path: 'getAttendance/:id?', component: getAttendance, name: '查看考勤设备' },
            { path: 'addAttendance', component: addAttendance, name: '添加考勤设备' },
            { path: 'classSetUp/:id?', component: classSetUp, name: '分班播报设置' },
            {
                path: '/deviceType',
                redirect: '/deviceType/index',
                component: logiLayout,
                name: '设备类型',
                noDropdown: false,
                children: [
                    { path: 'index', component: deviceType },
                    { path: 'getdeviceType/:id?', component: getdeviceType, name: '查看设备类型' }
                ]
            }
        ]
    },
    {
        path: '/cardManagement',
        redirect: 'cardManagement/cardManagement',
        component: Layout,
        name: '卡片管理',
        icon: 'zujian',
        meta: { cache: 'cardManagement' },
        noDropdown: true,
        children: [
            { path: 'cardManagement', component: cardManagement, name: '卡片管理' }
        ]
    }, { path: '*', redirect: '/404', hidden: true }
];
export default schoolAffairRouterMap